import com.github.stuxuhai.jpinyin.PinyinHelper;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import qt.dao.StationDao;
import qt.domain.Station;

import java.util.List;

/**
 * Created by yanlin on 2017/12/14.
 */
public class Main {
    public static void main(String args[]){
        ApplicationContext context = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
        StationDao stationDao = (StationDao) context.getBean("stationDao");
        List<Station> list = stationDao.getAllStation();
        System.out.println(list.get(1));
        int count = 1;
        for(Station station:list){
            stationDao.upsz(station.getStcd(), PinyinHelper.getShortPinyin(station.getStnm()));
            System.out.println(++count);
        }
    }
}
